<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page contentType="text/html; charset=utf-8" %>
<html>
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>TopFrame</title>
    <link rel="stylesheet" href="${resource(dir: 'css', file: 'frame.css')}" type="text/css">
    <script type="text/javascript">
        //显示当前日期时间
        function tick() {
            var hours, minutes, seconds, timeCN;
            var intHours, intMinutes, intSeconds;
            var today, theDay;
            today = new Date();

            theDay = today.getFullYear() + "年" + [today.getMonth() + 1] + "月" + today.getDate() + "日";
            intHours = today.getHours();
            intMinutes = today.getMinutes();
            intSeconds = today.getSeconds();
            if (intHours == 0) {
                hours = "12:";
                timeCN = "午夜";
            } else if (intHours < 12) {
                hours = intHours + ":";
                timeCN = "上午";
            } else if (intHours == 12) {
                hours = "12:";
                timeCN = "正午";
            } else {
                intHours = intHours - 12
                hours = intHours + ":";
                timeCN = "下午";
            }
            if (intMinutes < 10) {
                minutes = "0" + intMinutes + ":";
            } else {
                minutes = intMinutes + ":";
            }
            if (intSeconds < 10) {
                seconds = "0" + intSeconds;
            } else {
                seconds = intSeconds;
            }

            function initArray() {
                this.length = initArray.arguments.length
                for (var i = 0; i < this.length; i++)
                    this[i + 1] = initArray.arguments[i]
            }
            var weekCN = new initArray("星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六");
            var timeString = theDay + " " + timeCN + hours + minutes + seconds + ", " + weekCN[today.getDay() + 1];

            document.getElementById("currDateTime").innerHTML = timeString;

            window.setTimeout("tick();", 1000);
        }


        function logout() {
            if(confirm("您确定要退出当前系统吗？"))
                window.parent.location = "${request.contextPath}/auth/logout";
        }
    </script>
</head>

<body onload="tick();">
<div class="header_content">
    <div class="logo"><img src="${request.contextPath}/<app:appLogo/>" alt="<app:appName/>"/></div>

    <div class="right_nav">
        <div class="text_left">
            <ul class="nav_list">
                <li>数据日期：<g:formatDate date="${new Date()}" format="yyyy-MM-dd"/></li>
            </ul>
        </div>

        <div class="text_right">
            <ul class="nav_return">
                <li>
                    【<span id="currDateTime"></span>】
                </li>
                <li>
                    【<a href="#" onclick="return false;">企业网站</a> |  <a href="#" onclick="return false;">办公OA</a>】
                </li>
                <li>
                    【<a href="#" onclick="return false;">系统帮助</a> | <a href="javascript:logout();">安全退出</a>】&nbsp;&nbsp;
                </li>
            </ul>
        </div>
    </div>
</div>
</body>
</html>